package open_app

import (
	"organoid_public/domain/fitness"
	service2 "organoid_public/domain/fitness/service"
)

type service struct {
	svc service2.OpenAppServiceInterface
}

func NewService() (*service, error) {
	uc, err := fitness.Service()
	if err != nil {
		return nil, err
	}
	return &service{
		svc: uc.OpenAppSvc,
	}, nil
}

func (s *service) discernApp(openAppId string) (*DiscernRep, error) {
	data, err := s.svc.DiscernRepBelongApp(openAppId)
	if err != nil {
		return nil, err
	}
	return &DiscernRep{
		Id:        data.Id,
		OpenAppId: data.OpenAppId,
	}, err
}
